//
//  DesTripPhotosCVC.m
//  HappyTrip
//
//  Created by yuxuesong on 15-3-27.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "DesTripPhotosCVC.h"

@implementation DesTripPhotosCVC

- (void)dealloc
{
    [_photosImageView release];
    [_placePhotoObj release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if ( self) {
        self.photosImageView = [[UIImageView alloc] init];
        self.photosImageView.contentMode = UIViewContentModeScaleAspectFill;
        self.photosImageView.clipsToBounds = YES;
        [self.contentView addSubview:_photosImageView];
        [_photosImageView release];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    CGFloat width = self.bounds.size.width;
    CGFloat height = self.bounds.size.height;
    self.photosImageView.frame = CGRectMake(0, 0, width, height);
}

- (void)setPlacePhotoObj:(DesPlacePhotoObject *)placePhotoObj
{
    if (_placePhotoObj != placePhotoObj) {
        [_placePhotoObj release];
        _placePhotoObj = [placePhotoObj retain];
    }
    [self.photosImageView setImageWithURL:[NSURL URLWithString:self.placePhotoObj.photo] placeholderImage:[UIImage imageNamed:@"picLoading.png"]];
}

@end
